<template>
	
	<view>
	<u-notice-bar mode="horizontal" :list="list"></u-notice-bar>
	<u-swiper :list="img"></u-swiper>
			
		<zy-grid :grid-list=gridList :show-tip="true" :col="4"></zy-grid>
	</view>
	
</template>

<script>

		import zyGrid from '../../components/zy-grid/zy-grid.vue'
	export default {
		components:{
			zyGrid
		},
		
		data() {
			return {
				list: [
					'寒雨连江夜入吴',
					'平明送客楚山孤',
					'洛阳亲友如相问',
					'一片冰心在玉壶'
				],	
				img: [{
						image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
						title: '昨夜星辰昨夜风，画楼西畔桂堂东'
					},
					{
						image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
						title: '身无彩凤双飞翼，心有灵犀一点通'
					},
					{
						image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
						title: '谁念西风独自凉，萧萧黄叶闭疏窗，沉思往事立残阳'
					}
				],
				gridList: [	//格子数据列表
					{
						name: '成交统计',
						imgUrl: '../../static/zy-grid/grid-01.svg',
						tips: '',
						url:'/pages/deal/deal'
					},
					{
						name: '成交统计管理',
						imgUrl: '../../static/zy-grid/grid-02.svg',
						tips: '',
						url:'/pages/administration/administration'
					},
					{
						name: '报表查看',
						imgUrl: '../../static/zy-grid/grid-03.svg',
						tips: '',
						url:'/pages/report_view/report_view'
					},
					{
						name: '测试图标',
						imgUrl: '../../static/zy-grid/grid-04.svg',
						tips: ''
					},
					{
						name: '测试图标',
						imgUrl: '../../static/zy-grid/grid-05.svg',
						tips: ''
					},
					{
						name: '测试图标',
						imgUrl: '../../static/zy-grid/grid-06.svg',
						tips: ''
					},
					{
						name: '测试图标',
						imgUrl: '../../static/zy-grid/grid-07.svg',
						tips: ''
					},
					{
						name: '测试图标',
						imgUrl: '../../static/zy-grid/grid-08.svg',
						tips: ''
					},
					{
						name: '图表分析',
						imgUrl: '../../static/zy-grid/grid-09.svg',
						tips: '',
						url:'/pages/index/chars'
					},
					{
						name: '联系UEXPO',
						imgUrl: '../../static/zy-grid/grid-10.svg',
						tips: '',
						url:'/pages/index/number'
					},
					{
						name: '我的位置',
						imgUrl: '../../static/zy-grid/grid-11.svg',
						tips: '',
						url:'/pages/index/map'
					},
					{
						name: '更新日志',
						imgUrl: '../../static/zy-grid/grid-12.svg',
						tips: '',
						url:'/pages/index/timeline'
					}
				]
			}
					
		},
		onLoad() {
			console.log(this.$u.config.v);
			
			this.getSwipers()
			this.getGoods()
		},
		methods: {
		async	getSwipers(){
			const data = await this.$myRequest({
					url:'coupon/dtslideshow/list'
				})
			this.swipers = data.data.list
			},
			
				//获取热门商品数据
			async getGoods(){
					const data = await this.$myRequest({
							url:'coupon/dtarticle/list?page=2&limit=10'
						})
					this.goods = data.data.page.list;
					console.log(data.data.page.list)
				},
			
			//导航点击
			navItemCick(path){
				console.log("跳转",path)
				uni.navigateTo({
					url: path
				})
			}
		}
	

	
	

	}
</script>

<style lang="scss">

.home{
	swiper{
		width: 750rpx;
		height: 380rpx;
		image{
			height: 100%;
			width: 100%;
		}
	}
	.nav{
		display: flex;      //横向布局
	
		.nav-item{
			width: 25%;
		    text-align: center;
			
		
		text{
			font-size: 30rpx;
		}
		
		.iconfont icon-tupian{
			font-size: 45rpx;
		}
		
		}
		.nav-item1{
			view{
				width: 120rpx;
				height: 120rpx;
				background-color: $shop-color;
				border-radius: 60rpx;
				margin: 10px auto;
				line-height: 120rpx;
				color: #fff;
				font-size: 50rpx;
				text-align: center;
				margin: 0 auto;
			}
		}
	}
	
	
	.hot_goods{
		background: #eee;
		overflow: hidden;
		margin-top: 10rpx;
		.tit{
			height: 50px;
			line-height: 50px;
			text-align: center;
			letter-spacing: 20px; //设置文字间距
			background: #fff;
			margin: 7rpx 0rpx;
		}
	
	.goods_list{
		display: flex;  //商品横着
		padding: 0 15rpx;
		flex-wrap: wrap;  //商品换行
		justify-content: space-between;  //商品之间的间距
		.goods_item{
			background: #fff;
			width: 355rpx;
			margin: 10rpx 0rpx;
			padding: 15rpx;
			box-sizing: border-box; //盒子不被撑大
			image{
				display: block;
				margin: auto;
				width: 80%;
				height:150px;
				
			}
		}
		.price{
			color: $shop-color;
			font-size: 36rpx;
			margin: 20rpx 0 5rpx 0;
			text:nth-child(2){   //自定义
				color: #ccc;
				font-size: 28rpx;  
				margin-left: 17rpx;
				text-decoration: line-through; //设置金额波浪线
			}
		}
		.name{
			font-size: 28rpx;
			line-height: 50rpx;
			padding-bottom: 15rpx;
			padding-top: 10rpx;
		}
	}
	}


}

</style>
